package org.springframework;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.server.MessageServer;

/**
 * @version 1.0
 * @Author: chancy
 * @date: 2021/5/21 16:18
 */
public class SpringFrameworkApplication {

	private static int x = 100;

	public static void main(String[] args) {
		String config = "spring-config.xml";
		ApplicationContext context = new ClassPathXmlApplicationContext(config);

		MessageServer messageServer = context.getBean(MessageServer.class);

		messageServer.getMessage();


//		SpringFrameworkApplication hs1 = new SpringFrameworkApplication();
//		hs1.x++;
//		SpringFrameworkApplication hs2 = new SpringFrameworkApplication();
//		hs2.x++;
//		hs1 = new SpringFrameworkApplication();
//		hs1.x++;
//		SpringFrameworkApplication.x--;
//		System.out.println("x=" + x);
	}


}
